package com.ruitu.mall_98_seller.support.util;

public class Util {

    // 单位数前面加0,返回字符串
    public static String add0If1(int num) {
        if (num <= 0) throw new NumberFormatException("数字必须是两位正整数!");
        if (num > 99) throw new NumberFormatException("数字必须是两位正整数!");
        if (num < 10) {
            return "0" + num;
        }
        return "" + num;
    }
}
